<template>
  <div class="dashboard-root-lay">
    <div style="display: flex; flex-direction: row;">
      <div style="display: flex; flex: 22; flex-direction: column;">
        <el-card class="box-card" :shadow="shadow">
          <template #header>
            <span>当前登录用户数</span>
          </template>
          <div class="statistic-item">
            88/100000
          </div>
        </el-card>
        <el-card class="box-card" :shadow="shadow">
          <template #header>
            <span>总角色数</span>
          </template>
          <div class="statistic-item">
            138
          </div>
        </el-card>
      </div>
      <div style="display: flex; flex: 22; flex-direction: column;">
        <el-card class="box-card" :shadow="shadow">
          <template #header>
            <span>总权限数</span>
          </template>
          <div class="statistic-item">
            288
          </div>
        </el-card>
        <el-card class="box-card" :shadow="shadow">
          <template #header>
            <span>总客户数</span>
          </template>
          <div class="statistic-item">
            889
          </div>
        </el-card>
      </div>
      <el-card class="box-card" style="flex: 56;" :shadow="shadow" >
        <template #header>
          <span>用户信息</span>
        </template>
      </el-card>
    </div>
    <div style="display: flex; flex-direction: row; margin-top: 16px;">
      <el-card class="box-card" style="flex: 44" :shadow="shadow">
        <template #header>
          <span>平台信息</span>
        </template>
        <div style="display: flex; flex-direction: column">
          <div class="item-lay">
            <div style="width: 160px;">
              CPU信息
            </div>
            <div class="item-content">
              60%
            </div>
          </div>
          <div class="item-lay">
            <div style="width: 160px;">
              内存信息
            </div>
            <div class="item-content">
              1.8G
            </div>
          </div>
          <div class="item-lay">
            <div style="width: 160px;">
              创建时间
            </div>
            <div class="item-content">
              2020-01-28 10:01
            </div>
          </div>
        </div>
      </el-card>
      <el-card class="box-card" style="flex: 56" :shadow="shadow">
        <template #header>
          <span>服务器信息</span>
        </template>
        <div style="display: flex; flex-direction: column">
          <div class="item-lay">
            <div style="width: 160px;">
              CPU信息
            </div>
            <div class="item-content">
              80%
            </div>
          </div>
          <div class="item-lay">
            <div style="width: 160px;">
              内存信息
            </div>
            <div class="item-content">
              2.8G
            </div>
          </div>
          <div class="item-lay">
            <div style="width: 160px;">
              系统负载
            </div>
            <div class="item-content">
              0.8/0.9/0.6
            </div>
          </div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup lang="ts" name="dashboard">
import {ref} from "vue";

const shadow = ref('always');

</script>

<style>
.dashboard-root-lay {
  height: 100vh;
  display: flex;
  margin: 24px 16px;
  flex-direction: column;
  justify-content: stretch;
}

.box-card {
  margin: 8px 16px;
  border: none;
}

.statistic-item {
  font-weight: 500;
  font-size: 20px;
}

.item-lay {
  display: flex;
  flex-direction: row;
  padding: 2px 0;
}

.item-content {
  flex: 1;
  font-weight: 500;
}

</style>